package com.maben.disruptor.handler;

import com.lmax.disruptor.EventHandler;
import com.maben.disruptor.model.MessageModel;
import lombok.extern.slf4j.Slf4j;

/**
 * 创建【test】事件的处理者（也就是消费端）
 */
@Slf4j
public class TestEventHandler2 implements EventHandler<MessageModel> {
    @Override
    public void onEvent(MessageModel event, long sequence, boolean endOfBatch) {
        try {
            if (event != null) {
                log.info("*************receive message2：{}",event);
            }
        } catch (Exception e) {
            log.error("消费者处理消息失败");
        }
    }
}